﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using CPlatePrintSys.Domain.Events;
using MahApps.Metro.Controls;
using Prism.Events;
using Prism.Ioc;

namespace CPlatePrintSys.Win.Views
{
    /// <summary>
    /// ExportDocumentsView.xaml 的交互逻辑
    /// </summary>
    public partial class ExportDocumentsView : MetroWindow
    {

        private IEventAggregator _eventAggregator;

        public ExportDocumentsView()
        {
            _eventAggregator = (IEventAggregator)Prism.Ioc.ContainerLocator.Container.Resolve<IEventAggregator>();
            InitializeComponent();
            this.Loaded += ExportDocumentsView_Loaded;
            this.Closed += ExportDocumentsView_Closed;
        }

        private void ExportDocumentsView_Closed(object sender, EventArgs e)
        {
            _eventAggregator.GetEvent<WindowsPopupedEvent>().Publish(false);
        }

        private void ExportDocumentsView_Loaded(object sender, RoutedEventArgs e)
        {
            _eventAggregator.GetEvent<WindowsPopupedEvent>().Publish(true);
        }
    }
}
